package com.xxx.blog.controller;

import com.xxx.base.utils.R;
import com.xxx.blog.domain.Param;
import com.xxx.blog.service.ParamService;
import io.swagger.annotations.Api;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

@RestController
@RequestMapping("/param")
@Api(tags = "参数接口类")
public class ParamController {
    @Autowired
    private ParamService paramService;
    @GetMapping("/map")
    public Map<String,String> findAll() {
        List<Param> list = paramService.findAll();
        Map<String,String> map = new HashMap<>();
        list.forEach(param -> map.put(param.getParamKey(),param.getParamValue()));
        return map;
    }
}
